﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using W.Warehouse.Domain.AllocationProduct;
using W.Warehouse.Repository.Interface;

namespace W.Warehouse.Repository.Impl
{
    public class AllocationRepository : BaseRepositoy<Allocation>, IAllocationRepository
    {
        public AllocationRepository(EFCoreDbContext context) : base(context)
        {
        }

        public EFCoreDbContext DB
        {
            get { return base.DB; }
        }

        public async Task<int> AddAllocationAsync(Allocation t)
        {
            return await base.AddAsync(t);  
        }

        public async Task<List<Allocation>> GetAllAllocationAsync()
        {
            return await base.GetAllAsync();
        }

        public async Task<List<Allocation>> GetAllocationAsync(Expression<Func<Allocation, bool>> expre)
        {
            return await base.GetAsync(expre);
        }

        public async Task<Allocation> GetModelAllocationAsync(int id)
        {
            return await base.GetModelAsync(id);
        }

        public async Task<int> UpdateAllocationAsync(Allocation t)
        {
            return await base.UpdateAsync(t);
        }

        public async Task<int> UpdateRangeAllocationAsync(List<Allocation> t)
        {
            return await base.UpdateRangeAsync(t);
        }
    }
}
